<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="rootPath" value="${pageContext.request.contextPath}" scope="page" ></c:set>
<%--<!DOCTYPE html>--%>
<html lang="en">
<head>
<!--    <meta charset="UTF-8">-->
    <title>登&nbsp;&nbsp;录</title>
    <script  src="${rootPath}/backend/detail/style/js/jquery.js" type="text/javascript"></script>
    <script type="application/javascript">
        $(function(){
            if(window.parent != window){
                window.parent.location.reload(true);
            }
        })
        function getValidateCode(){
            $("#validateCode").attr("src","createCode?"+Math.random());
        }
    </script>
</head>
<body>
    <div style="width:450px;margin:50px auto;border:3px solid black;padding:30px;text-align: center">
        <h3>登&nbsp;&nbsp;录</h3>
        <form action="${rootPath}/userService/login" method="post">
            <div style="width:200px;margin:0 auto">用户名：<input type="text" name="username" value="${pageContext.session.getAttribute("username")}"></div>
            <div style="width:200px;margin:0 auto">密码：<input type="password" name="password" value="${pageContext.session.getAttribute("password")}"></div>
            <div style="width:200px;margin:0 auto">验证码：<input type="text" name="code"><img src="createCode" id="validateCode" onclick="getValidateCode()" /></div>
            <div style="margin:10px auto 0 auto"><input type="submit" value="登  录"></div>
        </form>
        <p style="text-align:center;color:red">${info}</p>
        <a href="register.jsp"><button>注册</button></a>
    </div>
</body>
</html>
